package com.stu.exercise.controller;

import com.stu.exercise.entity.R;
import com.stu.exercise.entity.User;
import com.stu.exercise.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @RequestMapping("/login")
    public R login(@RequestBody User user){
        return loginService.login(user);
    }

    @RequestMapping("/reset")
    public R reset(@RequestBody User user){
        return loginService.reset(user);
    }

}
